package com.xxh.dataaccess.service.impl;

import com.xxh.dataaccess.rpcservice.ClientGrpcService;
import com.xxh.dataaccess.service.RecallService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;


@Service
public class RecallServiceImpl implements RecallService {

    @Resource
    ClientGrpcService grpcService;


    @Override
    public boolean updateUserHistoryRecall() {
        try {
            grpcService.rpcUpdateUserHistoryRecall();
            return true;
        } catch (Exception e) {
            e.printStackTrace();
            return false;
        }

    }

    @Override
    public boolean updateUserProfileRecall() {
        try {
            grpcService.rpcUpdateUserProfileRecall();
            return true;
        } catch (Exception e) {
            e.printStackTrace();
            return false;
        }

    }


    @Override
    public boolean genUserProfileRecallByUid(Integer uid) {
        try {
            grpcService.rpcUpdateUserProfileRecallByUid(String.valueOf(uid));
            return true;
        } catch (Exception e) {
            e.printStackTrace();
            return false;
        }

    }
}
